#ifndef PARTICLE_H_
#define PARTICLE_H_

#include <stddef.h>

#include "curve.h"

typedef struct {
	float x, y, dx, dy;
	float radius;
} particle;

typedef struct {
	particle *particles;
	size_t particle_count;
	float current_lifetime;
} particle_set;

typedef struct {
	particle_set *particle_sets;
	size_t set_count;
	size_t current_set;
} particle_system;

particle_system particle_init(int count, int depth);
void particle_push(particle_system *system, curve_function func, float t_start, float t_end);
void particle_update(particle_system *system);

void particle_render(particle_system *system, float r, float g, float b, float alpha_multiplier);

void particle_destroy(particle_system *system);

#endif